import React from 'react';
import {StyleSheet, ToastAndroid, View, ProgressBarAndroid} from 'react-native';
import * as Color from "../constant/Color";
import * as Progress from 'react-native-progress';

/** ProgressBar
 * https://github.com/oblador/react-native-progress */
export default class ProgressBar extends React.Component {

    render() {
        return (
            <View style={styles.container}>
                <Progress.Bar       progress={0.3} width={200} />
                <Progress.Pie       progress={0.4} size={50} />
                <Progress.Circle    progress={0.4} size={30} />

                <Progress.Bar       width={200} indeterminate={true} />
                <Progress.Pie       size={50}   indeterminate={true} />
                <Progress.Circle    size={30}   indeterminate={true} />

                <ProgressBarAndroid />
                <ProgressBarAndroid styleAttr="Horizontal" />
                <ProgressBarAndroid styleAttr="Horizontal" color="#2196F3"/>
                <ProgressBarAndroid
                    styleAttr="Horizontal"
                    indeterminate={false}
                    progress={0.5}
                />
            </View>
        );
    }

    _show(text:string):void{
        ToastAndroid.show (text, ToastAndroid.SHORT);
    }
}

//样式定义
const styles = StyleSheet.create({
    container: {
        // flex:1,
        flexDirection: 'column',
        alignItems: 'center',
        // justifyContent: 'center',
        backgroundColor: Color.windowWhite,
    },
});


